// RMSListenSocket.h: interface for the CRMSListenSocket class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_RMSLISTENSOCKET_H__25C654CD_CEBC_46D5_A3F4_10A418F27E68__INCLUDED_)
#define AFX_RMSLISTENSOCKET_H__25C654CD_CEBC_46D5_A3F4_10A418F27E68__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "../Common/RMSThread.h"
#include "RMSClientSocket.h"
#include "RMSWaveSocket.h"
#include "RMSClientID.h"

using namespace std;

class CBaseServer;
class CRMSListenSocket : public CRMSThread  
{
public:
	CBaseServer		*pBaseServer;
	SOCKADDR_IN		saServer;
	int				PrimaryIP;

	CRMSListenSocket(CBaseServer*);
	virtual ~CRMSListenSocket();

	BOOL StartServer();
	void StopServer();

	void SetPause(BOOL bPause);

	DWORD Terminate(BOOL bCritical=FALSE);
	DWORD OnTerminate();
protected:
	virtual DWORD ThreadFunc();

private:
	BOOL SERVER_ACTIVE;
	BOOL m_bPause;

	SOCKET m_listenSocket;

	HANDLE		m_hNoClients;

};

#endif // !defined(AFX_RMSLISTENSOCKET_H__25C654CD_CEBC_46D5_A3F4_10A418F27E68__INCLUDED_)
